import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: Home
  },
  {
    path: "/drinks",
    name: "drinks",
    component: () =>
      import(/* webpackChunkName: "Drinks"*/ "../views/modules/Drinks")
  },
  {
    path: "/information",
    name: "information",
    redirect: "information/types/1",
    component: () =>
      import(
        /* webpackChunkName: "Information"*/ "../views/modules/Information"
      ),
    children: [
      {
        path: "types/:type",
        name: "types",
        component: () =>
          import(
            /* webpackChunkName: "InformationList"*/ "../views/modules/Information/List"
          )
      }
    ]
  },
  {
    path: "/prospectus",
    name: "prospectus",
    redirect: "prospectus/step1",
    component: () =>
      import(/* webpackChunkName: "Prospectus"*/ "../views/modules/Prospectus"),
    children: [
      {
        path: "step1",
        name: "step1",
        component: () =>
          import(
            /* webpackChunkName: "Step1"*/ "../views/modules/Prospectus/Step1"
          )
      },
      {
        path: "step2/:id",
        name: "step2",
        props: true,
        component: () =>
          import(
            /* webpackChunkName: "Step2"*/ "../views/modules/Prospectus/Step2"
          )
      },
      {
        path: "step3",
        name: "step3",
        redirect: "step3/step31",
        component: () =>
          import(
            /* webpackChunkName: "Step31"*/ "../views/modules/Prospectus/Step3/index.vue"
          ),
        children: [
          {
            path: "step31",
            name: "step31",
            component: () =>
              import(
                /* webpackChunkName: "Step31"*/ "../views/modules/Prospectus/Step3/Step31"
              )
          },
          {
            path: "step32",
            name: "step32",
            component: () =>
              import(
                /* webpackChunkName: "Step31"*/ "../views/modules/Prospectus/Step3/Step32"
              )
          }
        ]
      }
    ]
  },
  {
    path: "/viewer/:id",
    name: "viewer",
    component: () =>
      import(/* webpackChunkName: "Viewer"*/ "../views/modules/Viewer")
  }
];

const router = new VueRouter({
  routes
});

export default router;
